############################# # Opções do /etc/fstab EXT4 # ############################# # #The fstab file defines how filesystems are mounted at boot time. #For an ext4 filesystem, the "best" options depend on the specific #use case and priorities, such as performance, data integrity, or security. #Common and Recommended Options for General Use: # defaults: # This is a convenient shorthand that includes rw, suid, dev, exec, auto, nouser, and async. It provides a good balance for most scenarios. noatime: # Prevents the update of access times on files, which can reduce disk I/O and improve performance, especially for frequently accessed files. nodiratime: # Similar to noatime, but specifically for directory access times. nofail: # Particularly useful for external or less critical drives. It prevents the system from halting during boot if the device is not found. errors=remount-ro: # If an error occurs on the filesystem, it will be automatically remounted as read-only, preventing potential data corruption. # Options for Specific Use Cases: # # Performance Optimization (with potential data integrity trade-offs): nobarrier: Disables write barriers, which can improve performance on certain hardware configurations but may risk data loss during power failures. data=writeback: Improves performance by allowing data to be written asynchronously, but again, carries a higher risk of data loss in case of a crash. nodelalloc: Disables delayed allocation, which can be beneficial for specific workloads. # Security Enhancements: nodev: Prevents the interpretation of character or block special devices on the filesystem. nosuid: Disables set-user-ID and set-group-ID bits, preventing privilege escalation through executables on that filesystem. noexec: Prevents the execution of binaries from the filesystem. Use with caution, as it can break applications that rely on executing files from the mounted location (e.g., /tmp). # User Permissions: user: Allows any user to mount the filesystem. This implies noexec, nosuid, and nodev unless explicitly overridden. umask=000: Sets the default file creation mask, which can be useful for shared drives to ensure new files have specific permissions. Example fstab Entry: UUID=your_uuid_value /mount/point ext4 defaults,noatime,nofail 0 2 ex.: UUID=9AE4-62B5 /boot/efi vfat umask=0077 0 2 UUID=de933c27-2061-4dc0-944a-a7bd71a86d57 /boot ext4 defaults,noatime 0 2 UUID=7e99bfbe-ca27-4afb-9b88-9c8bddfb134c / ext4 defaults,noatime 0 1 UUID=9f37810a-7288-47e3-9bbe-7a864bd7b290 /home ext4 defaults,noatime 0 2 UUID=4ee1699b-a21c-4f5a-849d-f41aa37200ce /var ext4 defaults,noatime 0 2 UUID=43166bcb-eb7f-4f68-8360-3bd6c383f3c1 /data ext4 defaults,noatime 0 2 tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 # ############################################################################################################## # # UUID=182d8399-b0ff-4d5a-a0c2-1375fbb8dee5 / ext4 rw,noatime,nodiratime,commit=120,errors=remount-ro 0 1 # UUID=8d49898a-2219-443a-8337-bc58ed3e32bb /mnt/usb ext4 rw,noatime,nodiratime,nofail 0 2 # tmpfs /tmp tmpfs defaults,nosuid 0 0 # ############################## # Opções do /etc/fstab BTRFS # ############################## # ############################################################################################################## # UUID=partition-808c /boot ext4 defaults 0 1 # UUID=partition-809c / btrfs noatime,compress=zstd:2,space_cache=v2,autodefrag,subvol=@ 0 0 UUID=partition-810c /home btrfs noatime,compress=zstd:2,space_cache=v2,autodefrag,noexec,nodev,nosuid,subvol=@home 0 0 UUID=partition-811c /var btrfs noatime,compress=zstd:2,space_cache=v2,autodefrag,noexec,nodev,nosuid,subvol=@var 0 0 UUID=partition-812c /tmp btrfs noatime,compress=zstd:2,space_cache=v2,autodefrag,noexec,nodev,nosuid,subvol=@tmp 0 0 #